package com.chushouya.manager.dto.admin.attachment;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Date;

@ApiModel("附件列表")
@Data
public class AttachmentListDTO {

    @ApiModelProperty("附件ID")
    private Long attachmentId;

    @ApiModelProperty("父级目录ID")
    private Long directoryId;

    @ApiModelProperty("祖级列表")
    private String ancestors;

    @ApiModelProperty("附件名称")
    private String attachmentName;

    @ApiModelProperty("宽高")
    private String widthHeight;

    @ApiModelProperty("完整地址")
    private String fillUrl;

    @ApiModelProperty("文件大小（KB）")
    private BigDecimal fileSize;

    @ApiModelProperty("状态")
    private Byte status;

    @ApiModelProperty("状态描述")
    private String statusDesc;

    @ApiModelProperty("操作人")
    private String handleUser;

    @ApiModelProperty("文件类型")
    private String mimeType;

    @ApiModelProperty("创建时间")
    private Date createTime;

    @ApiModelProperty("更新时间")
    private Date updateTime;

    public String getStatusDesc() {
        if (status == null) {
            return "";
        }
        switch (status) {
            case 0:
                return "禁用";
            case 1:
                return "启用";
            default:
                return "未知";
        }
    }
}
